import Vue from 'vue'
import VueRouter from 'vue-router'
import Page1 from '../views/Page1'
import Page2 from '../views/Page2'
import Page11 from '../views/Page1-1'
import Page12 from '../views/Page1-2'

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      path: '/page1',
      component: Page1,
      children: [
        {
          path: '/page1/page1-1',
          component: Page11
        },
        {
          path: '/page1/page1-2',
          component: Page12
        },
        {
          path: '',
          redirect: '/page1/page1-1'
        }
      ]
    },
    {
      path: '/page2',
      component: Page2
    },
    {
      path: '/',
      redirect: '/page1'
    }
  ]
})
